//
//  YRJHotCityTableViewCell.m
//  YanRenjie
//
//  Created by dllo on 15/10/26.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

// 目的地----->中国----->热门城市

#import "YRJHotCityTableViewCell.h"

#define WIDTH self.frame.size.width
#define HEIGHT self.frame.size.height
@implementation YRJHotCityTableViewCell
- (void)dealloc {
    [_photoImageView release];
    [_cnnameLabel release];
    [_ennameLabel release];
    
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    self.photoImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.photoImageView];
    [_photoImageView release];
    
    self.cnnameLabel = [[UILabel alloc] init];
    [self.photoImageView addSubview:self.cnnameLabel];
    [_cnnameLabel release];
    self.cnnameLabel.textColor = [UIColor whiteColor];
    
    self.ennameLabel  = [[UILabel alloc] init];
    [self.photoImageView addSubview:self.ennameLabel];
    [_ennameLabel release];
    self.ennameLabel.textColor = [UIColor whiteColor];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.photoImageView.frame = CGRectMake((20.0 / 375.0) * WIDTH, (5.0 / HEIGHT) * HEIGHT, (335.0 / 375.0) * WIDTH, (160.0 / 170.0) * HEIGHT);
    self.cnnameLabel.frame = CGRectMake((10.0 / 375.0) * WIDTH, (90.0 / 170.0) * HEIGHT, (150.0 / 375.0) * WIDTH, (20.0 / 170.0) * HEIGHT);
    self.ennameLabel.frame = CGRectMake((10.0 / 375.0) * WIDTH, (120.0 / 170.0) * HEIGHT, (150.0 / 375.0) * WIDTH, (20.0 / 170.0) * HEIGHT);
    NSLog(@"%f", WIDTH);
    NSLog(@"%f", HEIGHT);
}
@end
